/*
 * EmeCoder v1.2.1.168
 * 作者：Administrator/ZYEEM-001
 * 时间：2014-04-02 15:26:00
 * 版权：版权所有 (C) Eme Development Team 2014
*/
﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Xml.Serialization;
using HmFramework.Data;
using HmFramework.Data.Configuration;
using HmFramework.Data.DataAccessLayer;

namespace CuteSprite.Eme.Data.Testing
{
    /// <summary>第二个测试</summary>
    [Serializable]
    [DataObject]
    [Description("第二个测试")]
    [BindIndex("PK__Test002ID__8ADD756FF14540D2", true, "ID")]
    [BindTable("Test002", Description = "第二个测试", ConnName = "EmeTest", DbType = DatabaseType.SqlServer)]
    public abstract partial class Test002<TEntity> : ITest002
    {
        #region 属性
        private Int32 _ID;
        /// <summary>主键</summary>
        [DisplayName("主键")]
        [Description("主键")]
        [DataObjectField(true, true, false, 10)]
        [BindColumn(0, "ID", "主键", null, "int", 10, 0, false)]
        public virtual Int32 ID
        {
            get { return _ID; }
            set { if (OnPropertyChanging(__.ID, value)) { _ID = value; OnPropertyChanged(__.ID); } }
        }

        private String _Name;
        /// <summary>名称</summary>
        [DisplayName("名称")]
        [Description("名称")]
        [DataObjectField(false, false, false, 50)]
        [BindColumn(2, "Name", "名称", null, "nvarchar(50)", 0, 0, true)]
        public virtual String Name
        {
            get { return _Name; }
            set { if (OnPropertyChanging(__.Name, value)) { _Name = value; OnPropertyChanged(__.Name); } }
        }

        private Int32 _AdministratorID;
        /// <summary>所属用户</summary>
        [DisplayName("所属用户")]
        [Description("所属用户")]
        [DataObjectField(false, false, true, 10)]
        [BindColumn(2, "AdministratorID", "所属用户", null, "int", 10, 0, false)]
        public virtual Int32 AdministratorID
        {
            get { return _AdministratorID; }
            set { if (OnPropertyChanging(__.AdministratorID, value)) { _AdministratorID = value; OnPropertyChanged(__.AdministratorID); } }
        }

        private Int32 _OrganizeID;
        /// <summary>所属部门</summary>
        [DisplayName("所属部门")]
        [Description("所属部门")]
        [DataObjectField(false, false, true, 10)]
        [BindColumn(2, "OrganizeID", "所属部门", null, "int", 10, 0, false)]
        public virtual Int32 OrganizeID
        {
            get { return _OrganizeID; }
            set { if (OnPropertyChanging(__.OrganizeID, value)) { _OrganizeID = value; OnPropertyChanged(__.OrganizeID); } }
        }

        private Int32 _Sort;
        /// <summary>排序</summary>
        [DisplayName("排序")]
        [Description("排序")]
        [DataObjectField(false, false, false, 10)]
        [BindColumn(10999, "Sort", "排序", null, "int", 10, 0, false)]
        public virtual Int32 Sort
        {
            get { return _Sort; }
            set { if (OnPropertyChanging(__.Sort, value)) { _Sort = value; OnPropertyChanged(__.Sort); } }
        }

        private Boolean _AllowEdit;
        /// <summary>允许编辑</summary>
        [DisplayName("允许编辑")]
        [Description("允许编辑")]
        [DataObjectField(false, false, false, 1)]
        [BindColumn(11000, "AllowEdit", "允许编辑", null, "bit", 0, 0, false)]
        public virtual Boolean AllowEdit
        {
            get { return _AllowEdit; }
            set { if (OnPropertyChanging(__.AllowEdit, value)) { _AllowEdit = value; OnPropertyChanged(__.AllowEdit); } }
        }

        private Boolean _AllowDelete;
        /// <summary>允许删除</summary>
        [DisplayName("允许删除")]
        [Description("允许删除")]
        [DataObjectField(false, false, false, 1)]
        [BindColumn(11001, "AllowDelete", "允许删除", null, "bit", 0, 0, false)]
        public virtual Boolean AllowDelete
        {
            get { return _AllowDelete; }
            set { if (OnPropertyChanging(__.AllowDelete, value)) { _AllowDelete = value; OnPropertyChanged(__.AllowDelete); } }
        }

        private Boolean _IsEnable;
        /// <summary>有效</summary>
        [DisplayName("有效")]
        [Description("有效")]
        [DataObjectField(false, false, false, 1)]
        [BindColumn(11003, "IsEnable", "有效", null, "bit", 0, 0, false)]
        public virtual Boolean IsEnable
        {
            get { return _IsEnable; }
            set { if (OnPropertyChanging(__.IsEnable, value)) { _IsEnable = value; OnPropertyChanged(__.IsEnable); } }
        }

        private Boolean _IsDelete;
        /// <summary>逻辑删除</summary>
        [DisplayName("逻辑删除")]
        [Description("逻辑删除")]
        [DataObjectField(false, false, false, 1)]
        [BindColumn(11004, "IsDelete", "逻辑删除", null, "bit", 0, 0, false)]
        public virtual Boolean IsDelete
        {
            get { return _IsDelete; }
            set { if (OnPropertyChanging(__.IsDelete, value)) { _IsDelete = value; OnPropertyChanged(__.IsDelete); } }
        }

        private DateTime _ModifiedOn;
        /// <summary>修改时间</summary>
        [DisplayName("修改时间")]
        [Description("修改时间")]
        [DataObjectField(false, false, false, 3)]
        [BindColumn(11005, "ModifiedOn", "修改时间", null, "datetime", 3, 0, false)]
        public virtual DateTime ModifiedOn
        {
            get { return _ModifiedOn; }
            set { if (OnPropertyChanging(__.ModifiedOn, value)) { _ModifiedOn = value; OnPropertyChanged(__.ModifiedOn); } }
        }

        private Int32 _ModifiedUserID;
        /// <summary>修改用户ID</summary>
        [DisplayName("修改用户ID")]
        [Description("修改用户ID")]
        [DataObjectField(false, false, false, 10)]
        [BindColumn(11006, "ModifiedUserID", "修改用户ID", null, "int", 10, 0, false)]
        public virtual Int32 ModifiedUserID
        {
            get { return _ModifiedUserID; }
            set { if (OnPropertyChanging(__.ModifiedUserID, value)) { _ModifiedUserID = value; OnPropertyChanged(__.ModifiedUserID); } }
        }

        private String _ModifiedBy;
        /// <summary>修改用户</summary>
        [DisplayName("修改用户")]
        [Description("修改用户")]
        [DataObjectField(false, false, false, 50)]
        [BindColumn(11007, "ModifiedBy", "修改用户", null, "nvarchar(50)", 0, 0, true)]
        public virtual String ModifiedBy
        {
            get { return _ModifiedBy; }
            set { if (OnPropertyChanging(__.ModifiedBy, value)) { _ModifiedBy = value; OnPropertyChanged(__.ModifiedBy); } }
        }

        private DateTime _CreateOn;
        /// <summary>创建时间</summary>
        [DisplayName("创建时间")]
        [Description("创建时间")]
        [DataObjectField(false, false, false, 3)]
        [BindColumn(11008, "CreateOn", "创建时间", null, "datetime", 3, 0, false)]
        public virtual DateTime CreateOn
        {
            get { return _CreateOn; }
            set { if (OnPropertyChanging(__.CreateOn, value)) { _CreateOn = value; OnPropertyChanged(__.CreateOn); } }
        }

        private Int32 _CreateUserID;
        /// <summary>创建用户ID</summary>
        [DisplayName("创建用户ID")]
        [Description("创建用户ID")]
        [DataObjectField(false, false, false, 10)]
        [BindColumn(11009, "CreateUserID", "创建用户ID", null, "int", 10, 0, false)]
        public virtual Int32 CreateUserID
        {
            get { return _CreateUserID; }
            set { if (OnPropertyChanging(__.CreateUserID, value)) { _CreateUserID = value; OnPropertyChanged(__.CreateUserID); } }
        }

        private String _CreateBy;
        /// <summary>创建用户</summary>
        [DisplayName("创建用户")]
        [Description("创建用户")]
        [DataObjectField(false, false, false, 50)]
        [BindColumn(11010, "CreateBy", "创建用户", null, "nvarchar(50)", 0, 0, true)]
        public virtual String CreateBy
        {
            get { return _CreateBy; }
            set { if (OnPropertyChanging(__.CreateBy, value)) { _CreateBy = value; OnPropertyChanged(__.CreateBy); } }
        }
        #endregion

        #region 获取/设置 字段值
        /// <summary>
        /// 获取/设置 字段值。
        /// 一个索引，基类使用反射实现。
        /// 派生实体类可重写该索引，以避免反射带来的性能损耗
        /// </summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        public override Object this[String name]
        {
            get
            {
                switch (name)
                {
                    case __.ID : return _ID;
                    case __.Name : return _Name;
                    case __.AdministratorID : return _AdministratorID;
                    case __.OrganizeID : return _OrganizeID;
                    case __.Sort : return _Sort;
                    case __.AllowEdit : return _AllowEdit;
                    case __.AllowDelete : return _AllowDelete;
                    case __.IsEnable : return _IsEnable;
                    case __.IsDelete : return _IsDelete;
                    case __.ModifiedOn : return _ModifiedOn;
                    case __.ModifiedUserID : return _ModifiedUserID;
                    case __.ModifiedBy : return _ModifiedBy;
                    case __.CreateOn : return _CreateOn;
                    case __.CreateUserID : return _CreateUserID;
                    case __.CreateBy : return _CreateBy;
                    default: return base[name];
                }
            }
            set
            {
                switch (name)
                {
                    case __.ID : _ID = Convert.ToInt32(value); break;
                    case __.Name : _Name = Convert.ToString(value); break;
                    case __.AdministratorID : _AdministratorID = Convert.ToInt32(value); break;
                    case __.OrganizeID : _OrganizeID = Convert.ToInt32(value); break;
                    case __.Sort : _Sort = Convert.ToInt32(value); break;
                    case __.AllowEdit : _AllowEdit = Convert.ToBoolean(value); break;
                    case __.AllowDelete : _AllowDelete = Convert.ToBoolean(value); break;
                    case __.IsEnable : _IsEnable = Convert.ToBoolean(value); break;
                    case __.IsDelete : _IsDelete = Convert.ToBoolean(value); break;
                    case __.ModifiedOn : _ModifiedOn = Convert.ToDateTime(value); break;
                    case __.ModifiedUserID : _ModifiedUserID = Convert.ToInt32(value); break;
                    case __.ModifiedBy : _ModifiedBy = Convert.ToString(value); break;
                    case __.CreateOn : _CreateOn = Convert.ToDateTime(value); break;
                    case __.CreateUserID : _CreateUserID = Convert.ToInt32(value); break;
                    case __.CreateBy : _CreateBy = Convert.ToString(value); break;
                    default: base[name] = value; break;
                }
            }
        }
        #endregion

        #region 字段名
        /// <summary>取得第二个测试字段信息的快捷方式</summary>
        public partial class _
        {
            ///<summary>主键</summary>
            public static readonly Field ID = FindByName(__.ID);

            ///<summary>名称</summary>
            public static readonly Field Name = FindByName(__.Name);

            ///<summary>所属用户</summary>
            public static readonly Field AdministratorID = FindByName(__.AdministratorID);

            ///<summary>所属部门</summary>
            public static readonly Field OrganizeID = FindByName(__.OrganizeID);

            ///<summary>排序</summary>
            public static readonly Field Sort = FindByName(__.Sort);

            ///<summary>允许编辑</summary>
            public static readonly Field AllowEdit = FindByName(__.AllowEdit);

            ///<summary>允许删除</summary>
            public static readonly Field AllowDelete = FindByName(__.AllowDelete);

            ///<summary>有效</summary>
            public static readonly Field IsEnable = FindByName(__.IsEnable);

            ///<summary>逻辑删除</summary>
            public static readonly Field IsDelete = FindByName(__.IsDelete);

            ///<summary>修改时间</summary>
            public static readonly Field ModifiedOn = FindByName(__.ModifiedOn);

            ///<summary>修改用户ID</summary>
            public static readonly Field ModifiedUserID = FindByName(__.ModifiedUserID);

            ///<summary>修改用户</summary>
            public static readonly Field ModifiedBy = FindByName(__.ModifiedBy);

            ///<summary>创建时间</summary>
            public static readonly Field CreateOn = FindByName(__.CreateOn);

            ///<summary>创建用户ID</summary>
            public static readonly Field CreateUserID = FindByName(__.CreateUserID);

            ///<summary>创建用户</summary>
            public static readonly Field CreateBy = FindByName(__.CreateBy);

            static Field FindByName(String name) { return Meta.Table.FindByName(name); }
        }

        /// <summary>取得第二个测试字段名称的快捷方式</summary>
        public partial class __
        {
            ///<summary>主键</summary>
            public const String ID = "ID";

            ///<summary>名称</summary>
            public const String Name = "Name";

            ///<summary>所属用户</summary>
            public const String AdministratorID = "AdministratorID";

            ///<summary>所属部门</summary>
            public const String OrganizeID = "OrganizeID";

            ///<summary>排序</summary>
            public const String Sort = "Sort";

            ///<summary>允许编辑</summary>
            public const String AllowEdit = "AllowEdit";

            ///<summary>允许删除</summary>
            public const String AllowDelete = "AllowDelete";

            ///<summary>有效</summary>
            public const String IsEnable = "IsEnable";

            ///<summary>逻辑删除</summary>
            public const String IsDelete = "IsDelete";

            ///<summary>修改时间</summary>
            public const String ModifiedOn = "ModifiedOn";

            ///<summary>修改用户ID</summary>
            public const String ModifiedUserID = "ModifiedUserID";

            ///<summary>修改用户</summary>
            public const String ModifiedBy = "ModifiedBy";

            ///<summary>创建时间</summary>
            public const String CreateOn = "CreateOn";

            ///<summary>创建用户ID</summary>
            public const String CreateUserID = "CreateUserID";

            ///<summary>创建用户</summary>
            public const String CreateBy = "CreateBy";

        }
        #endregion
    }

    /// <summary>第二个测试接口</summary>
    public partial interface ITest002
    {
        #region 属性
        /// <summary>主键</summary>
        Int32 ID { get; set; }

        /// <summary>名称</summary>
        String Name { get; set; }

        /// <summary>所属用户</summary>
        Int32 AdministratorID { get; set; }

        /// <summary>所属部门</summary>
        Int32 OrganizeID { get; set; }

        /// <summary>排序</summary>
        Int32 Sort { get; set; }

        /// <summary>允许编辑</summary>
        Boolean AllowEdit { get; set; }

        /// <summary>允许删除</summary>
        Boolean AllowDelete { get; set; }

        /// <summary>有效</summary>
        Boolean IsEnable { get; set; }

        /// <summary>逻辑删除</summary>
        Boolean IsDelete { get; set; }

        /// <summary>修改时间</summary>
        DateTime ModifiedOn { get; set; }

        /// <summary>修改用户ID</summary>
        Int32 ModifiedUserID { get; set; }

        /// <summary>修改用户</summary>
        String ModifiedBy { get; set; }

        /// <summary>创建时间</summary>
        DateTime CreateOn { get; set; }

        /// <summary>创建用户ID</summary>
        Int32 CreateUserID { get; set; }

        /// <summary>创建用户</summary>
        String CreateBy { get; set; }
        #endregion

        #region 获取/设置 字段值
        /// <summary>获取/设置 字段值。</summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        Object this[String name] { get; set; }
        #endregion
    }
}